CREATE TABLE [dbo].[SiteUser_SiteEvent]
(
[UserId] [int] NOT NULL,
[EventId] [int] NOT NULL,
[CreateDate] [datetime] NOT NULL,
[IsDeleted] [bit] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SiteUser_SiteEvent] ADD CONSTRAINT [PK_SiteUser_SiteEvent] PRIMARY KEY CLUSTERED  ([UserId], [EventId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SiteUser_SiteEvent] ADD CONSTRAINT [FK_SiteUser_SiteEvent_Events] FOREIGN KEY ([EventId]) REFERENCES [dbo].[SiteEvent] ([EventId])
GO
ALTER TABLE [dbo].[SiteUser_SiteEvent] ADD CONSTRAINT [FK_SiteUser_SiteEvent_Users] FOREIGN KEY ([UserId]) REFERENCES [dbo].[SiteUser] ([UserId])
GO
